function resumeViewNumFac(h){
	if(!resumeViewNumFac.popupDiv) resumeViewNumFac.popupDiv = resumeViewNumFac.fnBuildPopupDiv();
	var s = this;
	s.div = resumeViewNumFac.popupDiv;
	s.tabData = {3:"学历",4:"工作经验"};
	s.html = h;
	s.companyid = s.html.getAttribute("company")||"";
	s.rootcompany = s.html.getAttribute("rootcompany")||"";
	s.positionid = s.html.getAttribute("position")||"";
	s.typeid = s.html.getAttribute("viewtype")||3;
	s.ajaxHTML = {3:null,4:null};
	s.ajaxStatus = "ok";
	if(s.companyid!=""&&s.positionid!=""){
		s.C = function(e){s.fnClick(e);};
		myAttachEvent(s.html,'click',s.C);
	}
}
resumeViewNumFac.prototype = {
	fnClick : function(e){
		function getXY(ele){
		for(var x=0,y=0;ele;){
			x+=ele.offsetLeft;
			y+=ele.offsetTop;
			ele=ele.offsetParent; 
		}
		return {x:x,y:y};
	}
		
		var s = this;
		s.switchTab(s.typeid);
		//var pointer = $getXY(s.html);
		var pointer = getXY(s.html);
		var y = parseFloat(pointer.y-s.div.offsetHeight);
		if(y<0){
			s.div.top.style.display = "block";
			s.div.bottomArrow.style.display = "none";
			s.div.bottom.style.display = "block";
			y = parseFloat(pointer.y+s.html.offsetHeight);
		}
		else{
			s.div.top.style.display = "none";
			s.div.bottomArrow.style.display = "block";
			s.div.bottom.style.display = "none";
		}
		showPopup(s.div.id,e,parseFloat(pointer.x-220),y);
	},
	genTabHTML : function(){
		var s = this;
		var html = "";
		for(var i in s.tabData){
			html += '<li'+(s.typeid==i?' class="focusItem"':' onclick="window[\'mzpModuleIns\'][\''+s.html.id+'\'].switchTab(\''+i+'\')"')+'>'+(s.typeid!=i?'<a href="javascript:void(0)">':'')+s.tabData[i]+(s.typeid!=i?'</a>':'')+'</li>';
		}
		return html;
	},
	genFlashHTML : function(){
		var s = this;
		var html = '<div class="ajaxLoading"></div>';
		if(s.ajaxHTML[s.typeid]===null){//goto ajax
			s.div.ajaxCon.innerHTML = html;
			if(s.ajaxStatus=="ajax") return;
			s.ajaxStatus = "ajax";
			var data = "pid="+s.positionid+"&cid="+s.companyid+"&type_index="+s.typeid+"&rcid="+s.rootcompany;
			submitCallback(data, '/home/GetResumereportString', resumeViewNumFac.handleViewNumResponse, 'get', s);
			//resumeViewNumFac.test(data,'XXX.asp',resumeViewNumFac.handleViewNumResponse,'get',s);
		}
		else s.div.ajaxCon.innerHTML = resumeViewNumFac.flashHTML[0] + s.ajaxHTML[s.typeid] + resumeViewNumFac.flashHTML[1] + s.ajaxHTML[s.typeid] + resumeViewNumFac.flashHTML[2];		
	},
	switchTab : function(n){
		var s = this;
		if(s.ajaxStatus=="ajax") return;
		if(s.typeid!=n) s.typeid = n;
		s.div.tabCon.innerHTML = s.genTabHTML();
		s.genFlashHTML();
	}
}

resumeViewNumFac.closeViewNumDiv = function(){
	hideCurrentPopup();
}

resumeViewNumFac.fnBuildPopupDiv = function(){
	var div = document.createElement("div");
	div.id = "resumeViewNumFac_popup";
	div.className = "viewnumber_popupDiv";
	var subDiv = document.createElement("div");
	subDiv.className = "topArrow";
	div.appendChild(subDiv);
	div.top = subDiv;
	subDiv = document.createElement("div");
	subDiv.className = "tabViewNumCon";
	div.appendChild(subDiv);
	var subDiv2 = document.createElement("div");
	subDiv2.className = "blueCTL";
	subDiv.appendChild(subDiv2);
	subDiv2 = document.createElement("div");
	subDiv2.className = "blueCTR";
	subDiv.appendChild(subDiv2);
	subDiv2 = document.createElement("div");
	subDiv2.className = "closeDiv";
	subDiv2.title = "关闭";
	subDiv.appendChild(subDiv2);
	myAttachEvent(subDiv2,'click',resumeViewNumFac.closeViewNumDiv);
	var ul = document.createElement("ul");
	ul.className = "typeTab";
	subDiv.appendChild(ul);
	div.tabCon = ul;
	subDiv = document.createElement("div");
	subDiv.className = "flashCon";
	div.appendChild(subDiv);
	subDiv2 = document.createElement("div");
	subDiv2.className = "ajaxCon";
	subDiv.appendChild(subDiv2);
	div.ajaxCon = subDiv2;
	subDiv = document.createElement("div");
	subDiv.className = "bottomCon";
	div.appendChild(subDiv);
	div.bottomArrow = subDiv;
	subDiv2 = document.createElement("div");
	subDiv2.className = "blueCBL";
	subDiv.appendChild(subDiv2);
	subDiv2 = document.createElement("div");
	subDiv2.className = "blueCBR";
	subDiv.appendChild(subDiv2);
	subDiv = document.createElement("div");
	subDiv.className = "bottomConNoArrow";
	div.appendChild(subDiv);
	div.bottom = subDiv;
	subDiv2 = document.createElement("div");
	subDiv2.className = "blueCBL";
	subDiv.appendChild(subDiv2);
	subDiv2 = document.createElement("div");
	subDiv2.className = "blueCBR";
	subDiv.appendChild(subDiv2);
	document.body.appendChild(div);
	myAttachEvent(div,'click',cancelBubble);
	return div;
}

resumeViewNumFac.test = function(a,b,c,d,e){
	c(true,'pienumber=242,332,171,116,106,224,171,116,106,224&count_applied=5411&piecase=大专,本科,硕士,博士,MBA,EMBA,中专,中技,高中,初中',e);
}

resumeViewNumFac.handleViewNumResponse = function (success, responseText, objPar) {
    objPar.ajaxStatus = "ok";
    if (success) {
        if (responseText.indexOf("count_applied=") > -1) {
         
            objPar.ajaxHTML[objPar.typeid] = responseText;
            objPar.div.ajaxCon.innerHTML = resumeViewNumFac.flashHTML[0] + objPar.ajaxHTML[objPar.typeid] + resumeViewNumFac.flashHTML[1] + objPar.ajaxHTML[objPar.typeid] + resumeViewNumFac.flashHTML[2];
        }
        else objPar.div.ajaxCon.innerHTML = '<div class="noData"></div>';
    }
    else {//ajax error
      objPar.div.ajaxCon.innerHTML = "出错，请稍候再试！";
     // objPar.div.ajaxCon.innerHTML = '<div class="noData"></div>';
    }
}

resumeViewNumFac.flashHTML = ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="310" height="122"><param name="movie" value="http://myimg.zhaopin.com/images/new_v4/education.swf"><param name="quality" value="high"><param name="menu" value="false"><param name=wmode value="opaque"><param name="FlashVars" value="','"><embed src="http://myimg.zhaopin.com/images/new_v4/education.swf" wmode="opaque" FlashVars="','" menu="false" quality="high" width="310" height="122" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object> '];